<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

/**
 * Class TopUp
 *
 * @property int $id
 * @property int|null $company_id
 * @property Carbon|null $time
 * @property int|null $product_id
 * @property int|null $pay_status
 * @property string|null $out_trade_no
 * @property string|null $remark
 * @property Carbon|null $create_time
 * @property Carbon|null $update_time
 *
 * @property Company|null $company
 * @property MessageProduct|null $message_product
 *
 * @package App\Models
 */
class TopUp extends Model
{
    protected $connection = 'mysql_sms';
	protected $table = 'top_up';

	protected $casts = [
		'company_id' => 'int',
		'product_id' => 'int',
		'pay_status' => 'int'
	];

	protected $dates = [
		'time'
	];

	protected $fillable = [
		'company_id',
		'time',
		'product_id',
		'pay_status',
		'out_trade_no',
		'remark'
	];

	public function company()
	{
		return $this->belongsTo(Company::class);
	}

	public function message_product()
	{
		return $this->belongsTo(MessageProduct::class, 'product_id');
	}
}
